<?php

namespace App\Http\Controllers\User;

use App\Http\Controllers\Controller;
use App\Models\BalanceLog;
use Illuminate\Http\Request;

class BalanceLogsController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth:user');
    }

    public function index(Request $request)
    {
        $builder = BalanceLog::query()->where('user_id', $request->user('user')->id);


        $builder->latest();
        $logs = $builder->paginate(10);
        return view('user.balance_logs.index', compact('logs'));
    }
}
